﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AccountFlow.Models
{
    public enum JSModelStatus
    {
       S=1, N =2, U=4, D=8
    }
    public class JSModel
    {
        private string _status = JSModelStatus.N.ToString();
        public string DataStatus
        {
            get { return _status; }
            set { _status = value; isDirty = true; }
        }
        private bool isDirty = false;

        public bool IsDirty
        {
            get { return isDirty; }
            set { isDirty = value; LastModified = DateTime.Now; }
        }

        public DateTime LastModified { get; set; }
    }

    public class BookModel : JSModel
    {
      public   string ID { get; set; }
      public string TitleUrl { get; set; }
      public string Name { get; set; }
      public List<Chapter> Chapters { get; set; }
    }
    public class Chapter :JSModel
    {
        public string ID { get; set; }
        public string BookID { get; set; }
        public string Name { get; set; }
        public string Text { get; set; }
        public string Url { get; set; }
        public bool Active { get; set; }
        public List<Article> Articles { get; set; }
    }
    public class Article :JSModel
    {
        public string ID { get; set; }
        public string ChapterID { get; set; }
        public string Name { get; set; }
        public string Text { get; set; }
        public string Url { get; set; }
    }

}